<?php
/**
 * @var $model Language
 */
?>
<div class="form wide">

    <?php $form = $this->beginWidget('CActiveForm', array(
    'id' => 'language-form',
    'enableClientValidation' => true,
    'clientOptions' => array(
        'validateOnSubmit' => true,
    ),
)); ?>

    <p class="note">Fields with <span class="required">*</span> are required.</p>

    <?php echo $form->errorSummary($model); ?>

    <?php if (!$model->IsNewRecord) echo $form->hiddenField($model, "id"); ?>
    <div class="row">
        <?php echo $form->labelEx($model, 'name'); ?>
        <?php echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 255)); ?>
        <?php echo $form->error($model, 'name'); ?>
    </div>

    <?php if ($model->isNewRecord) : ?>
    <div class="row">
        <?php echo $form->labelEx($model, 'locale'); ?>
        <?php echo $form->dropDownlist($model, 'locale', $languageList, array('prompt' => 'Please select')); ?>
        <?php echo $form->error($model, 'locale'); ?>
    </div>
    <?php endif;?>
    <div class="row">
        <?php echo $form->labelEx($model, 'status'); ?>
        <?php echo $form->textField($model, 'status'); ?>
        <?php echo $form->error($model, 'status'); ?>
    </div>

    <?php if (!$model->isNewRecord) : ?>
    <div class="row">
        <?php echo $form->labelEx($model, 'create_time'); ?>
        <?php echo Yii::app()->getDateFormatter()->formatDateTime($model->create_time); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'update_time'); ?>
        <?php echo Yii::app()->getDateFormatter()->formatDateTime($model->update_time); ?>
    </div>
    <?php endif;?>

    <div class="row buttons">
        <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
    </div>

    <?php $this->endWidget(); ?>

</div><!-- form -->